import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  //主页面
  {
    path: '/index',
    name: 'Index',
    component: () => import('@/views/Index.vue'),
    children: [
      //首页
      {
        path: '/home',
        name: 'Home',
        component: () => import('@/views/index/Home.vue')
      },
      //课程页
      {
        path: '/course',
        name: 'Course',
        component: () => import('@/views/index/Course.vue')
      },
      //约课记录页
      {
        path: '/record',
        name: 'Record',
        component: () => import('@/views/index/Record.vue')
      },
      //学习页
      {
        path: '/practice',
        name: 'Practice',
        component: () => import('@/views/index/Practice.vue')
      },
      //我的页
      {
        path: '/my',
        name: 'My',
        component: () => import('@/views/index/My.vue')
      }
    ],
  },
]

const router = new VueRouter({
  routes
})

export default router
